import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2024-04-28
 * Time: 13:05
 *///TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static boolean isPalinNumber(int num) {
        int count = 0;
        int tmp = num;

        while (tmp != 0) {
            count++;
            tmp /= 10;
        }
        int right=num%10;
        int left=num/(10*(count-1));
        int i=1;
        while(right==left&&i<=count/2){
            i++;
            right=(num%(10*i))/(10*(i-1));
            left=num/(10*(count-i))%(10*(i-1));
        }if(i==count/2){
            return true;
        }else{
            return false;
        }

    }
    public static void main7(String[] args) {
        System.out.println("请输入你要判断的正整数：");
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNext()){
        int n=scanner.nextInt();
        if(isPalinNumber(n)){
            System.out.println("是回文数！");
        }else{
            System.out.println("不是回文数！");
        }
    }
    }
    public static double ctoFahrenheit(double celsius) {
        return (9.0/5)*celsius+32;
    }//摄氏温度转化为华氏温度
    public static double ftoCelsius(double Fahrenheit) {
        return (5.0/9)*(Fahrenheit-32);
    }//华氏温度转化摄氏温度
    public static void main5(String[] args) {
        for (int i = 10; i <= 50; i+=10) {
            System.out.println( ctoFahrenheit(i));
        }
        for (int i = 60; i <=100 ; i+=10) {
            System.out.println(ftoCelsius(i));
        }

    }
   public static void print(int m,int n){
       for (int i = 0; i < m; i++) {
           printStars(n,n);
           System.out.print("\n");
       }
   }
    public static void printStars(int row, int col){
        for (int i = 0; i < row; i++) {
            for (int i1 = 0; i1 < col; i1++) {
                System.out.print("*");
            }
            System.out.print("\n");
        }
    }
    public static void main(String[] args) {
        System.out.println("请输入m个n阶：");
        Scanner scanner = new Scanner(System.in);
        int m=scanner.nextInt();
        int n=scanner.nextInt();
        print(m,n);

    }
    public static int max3(int a,int b,int c){
        a=max2(a,b);
        return max2(a,c);

    }
    public static int max2(int m,int n){
        if(m>n){
            return m;
        }else{
            return n;
        }
    }
    public static void main3(String[] args) {
        System.out.println("请输入三个正整数:");
        Scanner scanner = new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int c=scanner.nextInt();
        System.out.println("最大数为："+max3(a,b,c));

    }
    public static int sumDigits(int num){
        int sum=0;
        while(num!=0){
            sum+=num%10;
            num/=10;
        }
        return sum;
    }
    public static void main2(String[] args) {
        System.out.println("请输入一个正整数>9:");
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            if (n > 9) {
                System.out.println(n + "的各位数字之和是：" + sumDigits(n));
            } else {
                System.out.println("请输入大于9的正整数");
            }

        }
    }
    public static void printScopePrime(int m, int n){
        for (int i = m; i <=n ; i++) {
            for (int j = 2; j <=(int)Math.sqrt(i) ; j++) {
                if(i%j==0){
                   break;
                }
                if(j==(int)Math.sqrt(i)){
                    System.out.print(i+"\t");
                }
            }
        }
    }
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入两个正整数m，n（m<n）：");
        int m= scanner.nextInt();
        int n= scanner.nextInt();

        if(m>n){
            System.out.println("参数不合法");
        }else{
            System.out.println(m+"和"+n+"之间的素数有：");
            printScopePrime(m,n);
        }
    }
}